The present invention is directed to a locking mechanism for use in sash windows, sliding patio doors, and the like, where entry from the outside is to be prevented when desired. The present invention is directed to selectively locking two movable sliding window or door parts, such that the parts cannot be slid relative to each other, whereby entry from the outside is effectively prevented, owing to the unique and novel manner by which the lock of the invention operates and by the manner by which it is released or unlocked. There are, of course, numerous types of locking structures that are used to prevent the relative sliding of a window sash or sliding door. For window sashes, a simple rotatable cam element is used on the upper portion of the lower window sash frame, which cooperates with a detent element on the juxtapositioned lower portion of the upper window sash, such being easily opened or unlocked from the outside by merely breaking the pane of glass, and extending one's arm interiorly to thereafter rotate the locking cam. Various other locks are also used, all of which suffer from the same disadvantage of allowing the unlocking or opening thereof from the outside, where the lock does not utilize a key-and-cylinder arrangement or is not a combination lock. With regard to patio doors, or other sliding doors, the typical lock employed is secured to the sliding door itself and operates in the same manner as all conventional locks, allowing the opening or unlocking thereof from the outside, when a key-and-cylinder or combination lock is not used. The present invention combines the safety benefits of a key-and-cylinder or combination lock with the ease-of-opening benefits of a conventional lock not controlled via a key or combination, so that entry from the outside is more effectively prevented as compared to the keyless locks, while being more easily operated from the inside as compared with a key-type lock.